using Xunit;

namespace CommunityToolkit.Maui.SourceGenerators.Internal.UnitTests.BindablePropertyAttributeSourceGeneratorTests;

public class CommonUsageTests : BaseBindablePropertyAttributeSourceGeneratorTest
{
	[Fact]
	public async Task GenerateBindableProperty_SimpleExample_GeneratesCorrectCode()
	{
		const string source =
			/* language=C#-test */
			//lang=csharp
			$$"""
			using CommunityToolkit.Maui;
			using Microsoft.Maui.Controls;

			namespace {{defaultTestNamespace}};

			public partial class {{defaultTestClassName}} : View
			{
			    [BindablePropertyAttribute]
			    public partial string Text { get; set; }
			}
			""";

		const string expectedGenerated =
			/* language=C#-test */
			//lang=csharp
			$$"""
			// <auto-generated>
			// See: CommunityToolkit.Maui.SourceGenerators.Internal.BindablePropertyAttributeSourceGenerator
			#pragma warning disable
			#nullable enable
			namespace {{defaultTestNamespace}};
			public partial class {{defaultTestClassName}}
			{
			    /// <summary>
			    /// Backing BindableProperty for the <see cref = "Text"/> property.
			    /// </summary>
			    public static readonly global::Microsoft.Maui.Controls.BindableProperty TextProperty = global::Microsoft.Maui.Controls.BindableProperty.Create("Text", typeof(string), typeof({{defaultTestNamespace}}.{{defaultTestClassName}}), null, Microsoft.Maui.Controls.BindingMode.OneWay, null, null, null, null, null);
			    public partial string Text { get => (string)GetValue(TextProperty); set => SetValue(TextProperty, value); }
			}
			""";

		await VerifySourceGeneratorAsync(source, expectedGenerated);
	}

	[Fact]
	public async Task GenerateBindableProperty_WithDefaultValue_GeneratesCorrectCode()
	{
		const string source =
			/* language=C#-test */
			//lang=csharp
			$$"""
			using CommunityToolkit.Maui;
			using Microsoft.Maui.Controls;

			namespace {{defaultTestNamespace}};

			public partial class {{defaultTestClassName}} : View
			{
			    [BindablePropertyAttribute(DefaultValue = "Hello")]
			    public partial string Text { get; set; }
			}
			""";

		const string expectedGenerated =
			/* language=C#-test */
			//lang=csharp
			$$"""
			// <auto-generated>
			// See: CommunityToolkit.Maui.SourceGenerators.Internal.BindablePropertyAttributeSourceGenerator
			#pragma warning disable
			#nullable enable
			namespace {{defaultTestNamespace}};
			public partial class {{defaultTestClassName}}
			{
			    /// <summary>
			    /// Backing BindableProperty for the <see cref = "Text"/> property.
			    /// </summary>
			    public static readonly global::Microsoft.Maui.Controls.BindableProperty TextProperty = global::Microsoft.Maui.Controls.BindableProperty.Create("Text", typeof(string), typeof({{defaultTestNamespace}}.{{defaultTestClassName}}), (string)"Hello", Microsoft.Maui.Controls.BindingMode.OneWay, null, null, null, null, null);
			    public partial string Text { get => (string)GetValue(TextProperty); set => SetValue(TextProperty, value); }
			}
			""";

		await VerifySourceGeneratorAsync(source, expectedGenerated);
	}

	[Fact]
	public async Task GenerateBindableProperty_WithNewKeyword_GeneratesCorrectCode()
	{
		const string source =
			/* language=C#-test */
			//lang=csharp
			$$"""
			using CommunityToolkit.Maui;
			using Microsoft.Maui.Controls;

			namespace {{defaultTestNamespace}};

			public partial class {{defaultTestClassName}} : View
			{
			    [BindablePropertyAttribute]
			    public new partial string Text { get; set; }
			}
			""";

		const string expectedGenerated =
			/* language=C#-test */
			//lang=csharp
			$$"""
			// <auto-generated>
			// See: CommunityToolkit.Maui.SourceGenerators.Internal.BindablePropertyAttributeSourceGenerator
			#pragma warning disable
			#nullable enable
			namespace {{defaultTestNamespace}};
			public partial class {{defaultTestClassName}}
			{
			    /// <summary>
			    /// Backing BindableProperty for the <see cref = "Text"/> property.
			    /// </summary>
			    public new static readonly global::Microsoft.Maui.Controls.BindableProperty TextProperty = global::Microsoft.Maui.Controls.BindableProperty.Create("Text", typeof(string), typeof({{defaultTestNamespace}}.{{defaultTestClassName}}), null, Microsoft.Maui.Controls.BindingMode.OneWay, null, null, null, null, null);
			    public new partial string Text { get => (string)GetValue(TextProperty); set => SetValue(TextProperty, value); }
			}
			""";

		await VerifySourceGeneratorAsync(source, expectedGenerated);
	}

	[Fact]
	public async Task GenerateBindableProperty_NullableReferenceType_GeneratesCorrectCode()
	{
		const string source =
			/* language=C#-test */
			//lang=csharp
			$$"""
			using CommunityToolkit.Maui;
			using Microsoft.Maui.Controls;

			namespace {{defaultTestNamespace}};

			public partial class {{defaultTestClassName}} : View
			{
			    [BindablePropertyAttribute]
			    public partial string? Text { get; set; }
			}
			""";

		const string expectedGenerated =
			/* language=C#-test */
			//lang=csharp
			$$"""
			// <auto-generated>
			// See: CommunityToolkit.Maui.SourceGenerators.Internal.BindablePropertyAttributeSourceGenerator
			#pragma warning disable
			#nullable enable
			namespace {{defaultTestNamespace}};
			public partial class {{defaultTestClassName}}
			{
			    /// <summary>
			    /// Backing BindableProperty for the <see cref = "Text"/> property.
			    /// </summary>
			    public static readonly global::Microsoft.Maui.Controls.BindableProperty TextProperty = global::Microsoft.Maui.Controls.BindableProperty.Create("Text", typeof(string), typeof({{defaultTestNamespace}}.{{defaultTestClassName}}), null, Microsoft.Maui.Controls.BindingMode.OneWay, null, null, null, null, null);
			    public partial string? Text { get => (string? )GetValue(TextProperty); set => SetValue(TextProperty, value); }
			}
			""";

		await VerifySourceGeneratorAsync(source, expectedGenerated);
	}

	[Fact]
	public async Task GenerateBindableProperty_MultipleProperties_GeneratesCorrectCode()
	{
		const string source =
			/* language=C#-test */
			//lang=csharp
			$$"""
			using CommunityToolkit.Maui;
			using Microsoft.Maui.Controls;

			namespace {{defaultTestNamespace}};

			public partial class {{defaultTestClassName}} : View
			{
			    [BindablePropertyAttribute]
			    public partial string Text { get; set; }

			    [BindablePropertyAttribute]
			    public partial int Number { get; set; }
			}
			""";

		const string expectedGenerated =
			/* language=C#-test */
			//lang=csharp
			$$"""
			// <auto-generated>
			// See: CommunityToolkit.Maui.SourceGenerators.Internal.BindablePropertyAttributeSourceGenerator
			#pragma warning disable
			#nullable enable
			namespace {{defaultTestNamespace}};
			public partial class {{defaultTestClassName}}
			{
			    /// <summary>
			    /// Backing BindableProperty for the <see cref = "Text"/> property.
			    /// </summary>
			    public static readonly global::Microsoft.Maui.Controls.BindableProperty TextProperty = global::Microsoft.Maui.Controls.BindableProperty.Create("Text", typeof(string), typeof({{defaultTestNamespace}}.{{defaultTestClassName}}), null, Microsoft.Maui.Controls.BindingMode.OneWay, null, null, null, null, null);
			    public partial string Text { get => (string)GetValue(TextProperty); set => SetValue(TextProperty, value); }

			    /// <summary>
			    /// Backing BindableProperty for the <see cref = "Number"/> property.
			    /// </summary>
			    public static readonly global::Microsoft.Maui.Controls.BindableProperty NumberProperty = global::Microsoft.Maui.Controls.BindableProperty.Create("Number", typeof(int), typeof({{defaultTestNamespace}}.{{defaultTestClassName}}), null, Microsoft.Maui.Controls.BindingMode.OneWay, null, null, null, null, null);
			    public partial int Number { get => (int)GetValue(NumberProperty); set => SetValue(NumberProperty, value); }
			}
			""";

		await VerifySourceGeneratorAsync(source, expectedGenerated);
	}

	[Fact]
	public async Task GenerateBindableProperty_WithAllParameters_GeneratesCorrectCode()
	{
		const string source =
			/* language=C#-test */
			//lang=csharp
			$$"""
			using CommunityToolkit.Maui;
			using Microsoft.Maui.Controls;

			namespace {{defaultTestNamespace}};

			public partial class {{defaultTestClassName}} : View
			{
			    [BindablePropertyAttribute(
			        DefaultValue = 42,
			        DefaultBindingMode = BindingMode.TwoWay,
			        ValidateValueMethodName = "ValidateValue",
			        PropertyChangedMethodName = "OnPropertyChanged",
			        PropertyChangingMethodName = "OnPropertyChanging",
			        CoerceValueMethodName = "CoerceValue",
			        DefaultValueCreatorMethodName = "CreateDefaultValue")]
			    public partial int Value { get; set; }

			    static bool ValidateValue(BindableObject bindable, object value) => true;
			    static void OnPropertyChanged(BindableObject bindable, object oldValue, object newValue) { }
			    static void OnPropertyChanging(BindableObject bindable, object oldValue, object newValue) { }
			    static object CoerceValue(BindableObject bindable, object value) => value;
			    static object CreateDefaultValue(BindableObject bindable) => 0;
			}
			""";

		const string expectedGenerated =
			/* language=C#-test */
			//lang=csharp
			$$"""
			// <auto-generated>
			// See: CommunityToolkit.Maui.SourceGenerators.Internal.BindablePropertyAttributeSourceGenerator
			#pragma warning disable
			#nullable enable
			namespace {{defaultTestNamespace}};
			public partial class {{defaultTestClassName}}
			{
			    /// <summary>
			    /// Backing BindableProperty for the <see cref = "Value"/> property.
			    /// </summary>
			    public static readonly global::Microsoft.Maui.Controls.BindableProperty ValueProperty = global::Microsoft.Maui.Controls.BindableProperty.Create("Value", typeof(int), typeof({{defaultTestNamespace}}.{{defaultTestClassName}}), (int)42, (Microsoft.Maui.Controls.BindingMode)1, ValidateValue, OnPropertyChanged, OnPropertyChanging, CoerceValue, CreateDefaultValue);
			    public partial int Value { get => (int)GetValue(ValueProperty); set => SetValue(ValueProperty, value); }
			}
			""";

		await VerifySourceGeneratorAsync(source, expectedGenerated);
	}

	[Fact]
	public async Task GenerateBindableProperty_InternalClass_GeneratesCorrectCode()
	{
		const string source =
			/* language=C#-test */
			//lang=csharp
			$$"""
			using CommunityToolkit.Maui;
			using Microsoft.Maui.Controls;

			namespace {{defaultTestNamespace}};

			internal partial class TestView : View
			{
			    [BindablePropertyAttribute]
			    public partial string Text { get; set; }
			}
			""";

		const string expectedGenerated =
			/* language=C#-test */
			//lang=csharp
			$$"""
			// <auto-generated>
			// See: CommunityToolkit.Maui.SourceGenerators.Internal.BindablePropertyAttributeSourceGenerator
			#pragma warning disable
			#nullable enable
			namespace {{defaultTestNamespace}};
			internal partial class TestView
			{
			    /// <summary>
			    /// Backing BindableProperty for the <see cref = "Text"/> property.
			    /// </summary>
			    public static readonly global::Microsoft.Maui.Controls.BindableProperty TextProperty = global::Microsoft.Maui.Controls.BindableProperty.Create("Text", typeof(string), typeof({{defaultTestNamespace}}.{{defaultTestClassName}}), null, Microsoft.Maui.Controls.BindingMode.OneWay, null, null, null, null, null);
			    public partial string Text { get => (string)GetValue(TextProperty); set => SetValue(TextProperty, value); }
			}
			""";

		await VerifySourceGeneratorAsync(source, expectedGenerated);
	}

	[Fact]
	public async Task GenerateBindableProperty_NoAttribute_GeneratesNoCode()
	{
		const string source =
			/* language=C#-test */
			//lang=csharp
			$$"""
			using Microsoft.Maui.Controls;

			namespace {{defaultTestNamespace}};

			public partial class {{defaultTestClassName}} : View
			{
			    public string Text { get; set; }
			}
			""";

		await VerifySourceGeneratorAsync(source, string.Empty);
	}

	[Fact]
	public async Task GenerateBindableProperty_EmptyClass_GeneratesAttributeOnly()
	{
		const string source =
			/* language=C#-test */
			//lang=csharp
			$$"""
			using Microsoft.Maui.Controls;

			namespace {{defaultTestNamespace}};

			public partial class {{defaultTestClassName}} : View
			{
			}
			""";

		await VerifySourceGeneratorAsync(source, string.Empty);
	}

	[Fact]
	public async Task GenerateBindableProperty_InternalSetter_GeneratesInternalSetter()
	{
		const string source =
			/* language=C#-test */
			//lang=csharp
			$$"""
			  using CommunityToolkit.Maui;
			  using Microsoft.Maui.Controls;

			  namespace {{defaultTestNamespace}};

			  public partial class {{defaultTestClassName}} : View
			  {
			      [BindablePropertyAttribute]
			      public partial string Text { get; internal set; }
			  }
			  """;

		const string expectedGenerated =
			/* language=C#-test */
			//lang=csharp
			$$"""
			  // <auto-generated>
			  // See: CommunityToolkit.Maui.SourceGenerators.Internal.BindablePropertyAttributeSourceGenerator
			  #pragma warning disable
			  #nullable enable
			  namespace {{defaultTestNamespace}};
			  public partial class {{defaultTestClassName}}
			  {
			      /// <summary>
			      /// Backing BindableProperty for the <see cref = "Text"/> property.
			      /// </summary>
			      public static readonly global::Microsoft.Maui.Controls.BindableProperty TextProperty = global::Microsoft.Maui.Controls.BindableProperty.Create("Text", typeof(string), typeof(TestNamespace.TestView), null, Microsoft.Maui.Controls.BindingMode.OneWay, null, null, null, null, null);
			      public partial string Text { get => (string)GetValue(TextProperty); internal set => SetValue(TextProperty, value); }
			  }
			  """;

		await VerifySourceGeneratorAsync(source, expectedGenerated);
	}

	[Fact]
	public async Task GenerateBindableProperty_PrivateProtectedSetter_GeneratesPrivateProtectedSetter()
	{
		const string source =
			/* language=C#-test */
			//lang=csharp
			$$"""
			  using CommunityToolkit.Maui;
			  using Microsoft.Maui.Controls;

			  namespace {{defaultTestNamespace}};

			  public partial class {{defaultTestClassName}} : View
			  {
			      [BindablePropertyAttribute]
			      public partial string Text { get; private protected set; }
			  }
			  """;

		const string expectedGenerated =
			/* language=C#-test */
			//lang=csharp
			$$"""
			  // <auto-generated>
			  // See: CommunityToolkit.Maui.SourceGenerators.Internal.BindablePropertyAttributeSourceGenerator
			  #pragma warning disable
			  #nullable enable
			  namespace {{defaultTestNamespace}};
			  public partial class {{defaultTestClassName}}
			  {
			      /// <summary>
			      /// Backing BindableProperty for the <see cref = "Text"/> property.
			      /// </summary>
			      static readonly global::Microsoft.Maui.Controls.BindablePropertyKey textPropertyKey = global::Microsoft.Maui.Controls.BindableProperty.CreateReadOnly("Text", typeof(string), typeof(TestNamespace.TestView), null, Microsoft.Maui.Controls.BindingMode.OneWay, null, null, null, null, null);
			      public static readonly global::Microsoft.Maui.Controls.BindableProperty TextProperty = textPropertyKey.BindableProperty;
			      public partial string Text { get => (string)GetValue(TextProperty); private protected set => SetValue(textPropertyKey, value); }
			  }
			  """;

		await VerifySourceGeneratorAsync(source, expectedGenerated);
	}

	[Fact]
	public async Task GenerateBindableProperty_ProtectedInternalSetter_GeneratesPrivateProtectedSetter()
	{
		const string source =
			/* language=C#-test */
			//lang=csharp
			$$"""
			  using CommunityToolkit.Maui;
			  using Microsoft.Maui.Controls;

			  namespace {{defaultTestNamespace}};

			  public partial class {{defaultTestClassName}} : View
			  {
			      [BindablePropertyAttribute]
			      public partial string Text { get; protected internal set; }
			  }
			  """;

		const string expectedGenerated =
			/* language=C#-test */
			//lang=csharp
			$$"""
			  // <auto-generated>
			  // See: CommunityToolkit.Maui.SourceGenerators.Internal.BindablePropertyAttributeSourceGenerator
			  #pragma warning disable
			  #nullable enable
			  namespace {{defaultTestNamespace}};
			  public partial class {{defaultTestClassName}}
			  {
			      /// <summary>
			      /// Backing BindableProperty for the <see cref = "Text"/> property.
			      /// </summary>
			      public static readonly global::Microsoft.Maui.Controls.BindableProperty TextProperty = global::Microsoft.Maui.Controls.BindableProperty.Create("Text", typeof(string), typeof(TestNamespace.TestView), null, Microsoft.Maui.Controls.BindingMode.OneWay, null, null, null, null, null);
			      public partial string Text { get => (string)GetValue(TextProperty); protected internal set => SetValue(TextProperty, value); }
			  }
			  """;

		await VerifySourceGeneratorAsync(source, expectedGenerated);
	}

	[Fact]
	public async Task GenerateBindableProperty_ProtectedSetter_GeneratesProtectedSetter()
	{
		const string source =
			/* language=C#-test */
			//lang=csharp
			$$"""
			  using CommunityToolkit.Maui;
			  using Microsoft.Maui.Controls;

			  namespace {{defaultTestNamespace}};

			  public partial class {{defaultTestClassName}} : View
			  {
			      [BindablePropertyAttribute]
			      public partial string Text { get; protected set; }
			  }
			  """;

		const string expectedGenerated =
			/* language=C#-test */
			//lang=csharp
			$$"""
			  // <auto-generated>
			  // See: CommunityToolkit.Maui.SourceGenerators.Internal.BindablePropertyAttributeSourceGenerator
			  #pragma warning disable
			  #nullable enable
			  namespace {{defaultTestNamespace}};
			  public partial class {{defaultTestClassName}}
			  {
			      /// <summary>
			      /// Backing BindableProperty for the <see cref = "Text"/> property.
			      /// </summary>
			      static readonly global::Microsoft.Maui.Controls.BindablePropertyKey textPropertyKey = global::Microsoft.Maui.Controls.BindableProperty.CreateReadOnly("Text", typeof(string), typeof(TestNamespace.TestView), null, Microsoft.Maui.Controls.BindingMode.OneWay, null, null, null, null, null);
			      public static readonly global::Microsoft.Maui.Controls.BindableProperty TextProperty = textPropertyKey.BindableProperty;
			      public partial string Text { get => (string)GetValue(TextProperty); protected set => SetValue(textPropertyKey, value); }
			  }
			  """;

		await VerifySourceGeneratorAsync(source, expectedGenerated);
	}

	[Fact]
	public async Task GenerateBindableProperty_PrivateSetter_GeneratesPrivateSetter()
	{
		const string source =
			/* language=C#-test */
			//lang=csharp
			$$"""
			using CommunityToolkit.Maui;
			using Microsoft.Maui.Controls;

			namespace {{defaultTestNamespace}};

			public partial class {{defaultTestClassName}} : View
			{
			    [BindablePropertyAttribute]
			    public partial string Text { get; private set; }
			}
			""";

		const string expectedGenerated =
			/* language=C#-test */
			//lang=csharp
			$$"""
			// <auto-generated>
			// See: CommunityToolkit.Maui.SourceGenerators.Internal.BindablePropertyAttributeSourceGenerator
			#pragma warning disable
			#nullable enable
			namespace {{defaultTestNamespace}};
			public partial class {{defaultTestClassName}}
			{
			    /// <summary>
			    /// Backing BindableProperty for the <see cref = "Text"/> property.
			    /// </summary>
			    static readonly global::Microsoft.Maui.Controls.BindablePropertyKey textPropertyKey = global::Microsoft.Maui.Controls.BindableProperty.CreateReadOnly("Text", typeof(string), typeof(TestNamespace.TestView), null, Microsoft.Maui.Controls.BindingMode.OneWay, null, null, null, null, null);
			    public static readonly global::Microsoft.Maui.Controls.BindableProperty TextProperty = textPropertyKey.BindableProperty;
			    public partial string Text { get => (string)GetValue(TextProperty); private set => SetValue(textPropertyKey, value); }
			}
			""";

		await VerifySourceGeneratorAsync(source, expectedGenerated);
	}

	[Fact]
	public async Task GenerateBindableProperty_GetOnly_GeneratesGetterOnly()
	{
		const string source =
			/* language=C#-test */
			//lang=csharp
			$$"""
			using CommunityToolkit.Maui;
			using Microsoft.Maui.Controls;

			namespace {{defaultTestNamespace}};

			public partial class {{defaultTestClassName}} : View
			{
			    [BindablePropertyAttribute]
			    public partial string Text { get; }
			}
			""";

		const string expectedGenerated =
			/* language=C#-test */
			//lang=csharp
			$$"""
			// <auto-generated>
			// See: CommunityToolkit.Maui.SourceGenerators.Internal.BindablePropertyAttributeSourceGenerator
			#pragma warning disable
			#nullable enable
			namespace {{defaultTestNamespace}};
			public partial class {{defaultTestClassName}}
			{
			    /// <summary>
			    /// Backing BindableProperty for the <see cref = "Text"/> property.
			    /// </summary>
			    static readonly global::Microsoft.Maui.Controls.BindablePropertyKey textPropertyKey = global::Microsoft.Maui.Controls.BindableProperty.CreateReadOnly("Text", typeof(string), typeof({{defaultTestNamespace}}.{{defaultTestClassName}}), null, Microsoft.Maui.Controls.BindingMode.OneWay, null, null, null, null, null);
			    public static readonly global::Microsoft.Maui.Controls.BindableProperty TextProperty = textPropertyKey.BindableProperty;
			    public partial string Text { get => (string)GetValue(TextProperty); }
			}
			""";

		await VerifySourceGeneratorAsync(source, expectedGenerated);
	}

	[Fact]
	public async Task GenerateBindableProperty_WithTimeSpanStringDefaultValue_GeneratesCorrectCode()
	{
		const string source =
			/* language=C#-test */
			//lang=csharp
			$$"""
			using CommunityToolkit.Maui;
			using Microsoft.Maui.Controls;
			using System;

			namespace {{defaultTestNamespace}};

			public partial class {{defaultTestClassName}} : View
			{
			    [BindablePropertyAttribute(DefaultValue = "00:00:00")]
			    public partial TimeSpan Position { get; set; }

			    [BindablePropertyAttribute(DefaultValue = "00:01:30")]
			    public partial TimeSpan CustomDuration { get; set; }
			}
			""";

		const string expectedGenerated =
			/* language=C#-test */
			//lang=csharp
			$$"""
			// <auto-generated>
			// See: CommunityToolkit.Maui.SourceGenerators.Internal.BindablePropertyAttributeSourceGenerator
			#pragma warning disable
			#nullable enable
			namespace {{defaultTestNamespace}};
			public partial class {{defaultTestClassName}}
			{
			    /// <summary>
			    /// Backing BindableProperty for the <see cref = "Position"/> property.
			    /// </summary>
			    public static readonly global::Microsoft.Maui.Controls.BindableProperty PositionProperty = global::Microsoft.Maui.Controls.BindableProperty.Create("Position", typeof(System.TimeSpan), typeof({{defaultTestNamespace}}.{{defaultTestClassName}}), global::System.TimeSpan.Zero, Microsoft.Maui.Controls.BindingMode.OneWay, null, null, null, null, null);
			    public partial System.TimeSpan Position { get => (System.TimeSpan)GetValue(PositionProperty); set => SetValue(PositionProperty, value); }

			    /// <summary>
			    /// Backing BindableProperty for the <see cref = "CustomDuration"/> property.
			    /// </summary>
			    public static readonly global::Microsoft.Maui.Controls.BindableProperty CustomDurationProperty = global::Microsoft.Maui.Controls.BindableProperty.Create("CustomDuration", typeof(System.TimeSpan), typeof({{defaultTestNamespace}}.{{defaultTestClassName}}), new global::System.TimeSpan(900000000), Microsoft.Maui.Controls.BindingMode.OneWay, null, null, null, null, null);
			    public partial System.TimeSpan CustomDuration { get => (System.TimeSpan)GetValue(CustomDurationProperty); set => SetValue(CustomDurationProperty, value); }
			}
			""";

		await VerifySourceGeneratorAsync(source, expectedGenerated);
	}
}